<template>
	<view class="container" v-if='showPage'>
		<navbar title='推广名片' background="trasparent"></navbar>
		<view class="bg">
			<image :src='poster' show-menu-by-longpress='true'></image>
		</view>
		<view class="wrap">
			<view class="code-bg"></view>
			<button class="btn line-center">长按保存图片</button>
		</view>
	</view>
</template>

<script>
	const app = getApp()
	export default {
		data() {
			return {
				poster:'',
				showPage:false
			};
		},
		onLoad() {
			uni.showLoading({
				title:'加载中...',
				mask:true
			})
			this.getInvitePoster()
		},
		methods:{
			getInvitePoster(){
				app.globalRequest({
					api:app.getApi().promotion.userShareImg
				}).then(res => {
					this.showPage = true;
					if (res.code == 0) {
						this.poster = res.data;
					}
				}).catch(err => {
					
				})
			}
		}
	}
</script>
<style>
	page{
		width: 100%;
		height: 100%;
		overflow-y: hidden;
	}
</style>
<style lang="scss" scoped>
	.container{
		width: 100%;
		height: 100%;
		position: relative;
	}
	.bg{
		width: 100%;
		height: 100%;
		position: absolute;
		left:0;
		top:0;
		overflow-y: hidden;
		z-index:22;
		image{
			width: 100%;
			height: 100%;
		}
	}
	.code-bg{
		width: 676rpx;
		height: 992rpx;
		position: relative;
		margin:auto;
		image{
			width: 100%;
			height: 100%;
		}
		.code{
			width: 380rpx;
			height: 380rpx;
			background: red;
			position: absolute;
			left:0;
			right:0;
			margin:auto;
			top:146rpx;
		}
	}
	.btn{
		width: 640rpx;
		height: 94rpx;
		background: #000000;
		border-radius: 48rpx;
		color:#fff;
		font-size: 32rpx;
		position: absolute;
		left:0;
		right:0;
		margin:auto;
		bottom:120rpx;
		z-index:223
	}
</style>
